using System;
using System.Collections.Generic;
using DMS.BEs;
using DMS.BEs.Gifts;
using DMS.DAOs;
using DMS.DTOs;
using DMS.Filters;
using DMS.Models;

namespace DMS.Services.Impl
{
	public class MarketingService : ServiceBase, IMarketingService
	{
		private readonly IMarketingModel model;

		public MarketingService(IMarketingModel model)
		{
			if (model == null) throw new ArgumentNullException("model");
			
			this.model = model;
		}

		public ResultDTO<GiftDTO> GetWinner(int year, int month)
		{
			Invoice invoice = model.GetWinner(year, month);

			return new ResultDTO<GiftDTO>(mapperBEtoDTO.Map<Invoice, GiftDTO>(invoice));
		}
	}
}